//表单验证规则
const yardRrules = {  // 添加堆场和编辑堆场 
    yardNum:[{ required: true, trigger: "blur", message: "不能为空" }],
    yardName: [
      { required: true, trigger: "blur", message: "不能为空" },
      { max: 50, trigger: "change", message: "不能超过50个字符" },
      { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
      { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
    ],
    yardAddress: [
      { required: true, trigger: "change", message: "不能为空" },
      { max: 200, trigger: "change", message: "不能超过200个字符" },
      { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
      // { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
    ],
    yardCity: [{ required: true, trigger: "change", message: "不能为空" }],
    yardCompanyName:[
      { required: true, trigger: "change", message: "不能为空" },
      { max: 200, trigger: "change", message: "不能超过200个字符" },
      { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
      { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
    ],
    'yardCityInfo.countryCName': [{ required: true, trigger: "change", message: "不能为空" }],
    contacts: [{ required: true, trigger: "blur", message: "不能为空" }],
    tel: [{ required: true, trigger: "blur", message: "不能为空" }],
    workTime: [
      { required: true, trigger: "blur", message: "不能为空" },
      { max: 30, trigger: "change", message: "不能超过30个字符" },
      { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
      { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
    ],
    email: [{ required: true, trigger: "blur", message: "不能为空" }],
    remark:[
      { max: 1000, trigger: "change", message: "不能超过1000个字符" },
      // { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
      // { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
    ]
}
const containerRules1 = {  // 添加集装
    containerNo: [
      { required: true, trigger: "blur", message: "不能为空" },
      { pattern:/^[A-Z]{3}U\d{7}$/, message: "箱号格式为 ABC+U+1234567", trigger: "blur" }
    ],
    boxType: [{ required: true, trigger: "change", message: "不能为空" }],
    boxCondition:  [{ required: true, trigger: "change", message: "不能为空" }],
    totalWeight:  [{ required: true, trigger: "blur", message: "不能为空" }],
    boxUsagePeriod:  [{ required: true, trigger: "blur", message: "不能为空" }],
    overdueFeeDay:  [
      { required: true, trigger: "blur", message: "不能为空" },
      { pattern: /^\d*$/, message: '只能输入数字', trigger: 'blur' }
    ],
    status: [{ required: true, trigger: "change", message: "不能为空" }],
    containerClassify: [{ required: true, trigger: "change", message: "不能为空" }],
    outBoxCompanyName: [
      { required: true, trigger: "change", message: "不能为空" },
      { pattern: /^[\p{L}\s]+$/u, message: "只能输入文字，不能包含数字、符号或表情", trigger: "blur"},
      { max: 200, message: '内容长度不能超过200个字符', trigger: 'blur' }
    ],
    agentName: [
      { required: true, trigger: "change", message: "不能为空" },
      { pattern: /^[\p{L}\s]+$/u, message: "只能输入文字，不能包含数字、符号或表情", trigger: "blur"},
      { max: 200, message: '内容长度不能超过200个字符', trigger: 'blur' }
     ],
   
    backCity: [{ required: true, trigger: "change", message: "不能为空" }],
    carryCity: [{ required: true, trigger: "change", message: "不能为空" }],
    outDate: [{ required: true, trigger: "blur", message: "不能为空" }],
    outDays:  [{ required: true, trigger: "blur", message: "不能为空" }],
    inDays:  [{ required: true, trigger: "blur", message: "不能为空" }],
    inDate: [{ required: true, trigger: "blur", message: "不能为空" }],
    remark:[
      { max: 1000, message: '内容长度不能超过1000个字符', trigger: 'blur' },
      // { pattern: /^[\p{L}\s]+$/u, message: "只能输入文字，不能包含数字、符号或表情",trigger: "blur"}
    ]
    
}
const containerRules2 = { // 编辑集装箱
    containerNo:[
      { required: true, trigger: "blur", message: "不能为空" },
      { pattern:/^[A-Z]{3}U\d{7}$/, message: "箱号格式为 ABC+U+1234567dd", trigger: "blur" }
    ],
    oidContainerNo:[{ required: true, trigger: "blur", message: "不能为空" }],
    boxType:[{ required: true, trigger: "blur", message: "不能为空" }],
    inDate:[{ required: true, trigger: "blur", message: "不能为空" }],
    status:[{ required: true, trigger: "blur", message: "不能为空" }],
    outDays:[{ required: true, trigger: "blur", message: "不能为空" }],
    outDate:[{ required: true, trigger: "blur", message: "不能为空" }],
    containerClassify:[{ required: true, trigger: "blur", message: "不能为空" }],
    outBoxCompanyName:[
      { required: true, trigger: "blur", message: "不能为空" },
      { pattern: /^[\p{L}\s]+$/u, message: "只能输入文字，不能包含数字、符号或表情", trigger: "blur"},
      { max: 200, message: '内容长度不能超过200个字符', trigger: 'blur' }
    ],
    boxCondition:[{ required: true, trigger: "blur", message: "不能为空" }],
    totalWeight:[{ required: true, trigger: "blur", message: "不能为空" }],
    boxUsagePeriod:[
      { required: true, trigger: "blur", message: "不能为空" },
      { pattern: /^\d*$/, message: '只能输入数字', trigger: 'blur' }
    ],
    carryCityId:[{ required: true, trigger: "blur", message: "不能为空" }],
    returnCityId:[{ required: true, trigger: "blur", message: "不能为空" }],
    overdueFeeDay:[
      { required: true, trigger: "blur", message: "不能为空" },
      { pattern: /^\d*$/, message: '只能输入数字', trigger: 'blur' }
    ],
    agentName:[
      { required: true, trigger: "blur", message: "不能为空" },
      { max:200, trigger: "blur", message: "最多输入200位"},
      { 
        validator: (rule, value, callback) => {
          if(containsNewlines(value)){
            callback(new Error('禁止输入换行符'));
          }else if(containsEmoji(value)){
            callback(new Error('禁止表情符号'));
          }else{
            callback();
          }
        },
        trigger: 'blur' 
      }
    ],
    remark:[{ max: 1000, message: '内容长度不能超过1000个字符', trigger: 'blur' }]
}

const containerRules3 = {// 集装箱管理 批量填写 费用明细/修改业务信息/
    businessNo:[
      { required: true, trigger: "blur", message: "业务编号不能为空" },
      { pattern: /^[a-zA-Z0-9]+$/, message: '只能输入字母和数字',trigger: 'blur' },
      { max: 30, message: '只能输入30个字符',trigger: 'blur' }
    ],
    rentInPrice:[
      { required: true, trigger: "blur", message: "不能为空" },
      { 
        validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    rentOutPrice:[{ required: true, trigger: "blur", message: "不能为空" },
      { 
        validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    buyInPrice:[{ required: true, trigger: "blur", message: "不能为空" },
    {
      validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
    }],
    sellOutPrice:[{ required: true, trigger: "blur", message: "不能为空" },
    {
      validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
      },
      trigger: 'blur'
    }],
    receivableLiftingFee:[
      // { required: true, trigger: "blur", message: "不能为空" },
      {
        validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    boxLabelPrice:[
      { required: true, trigger: "blur", message: "不能为空" },
      {
        validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    receivableStorageFeePrice:[
      // { required: true, trigger: "blur", message: "不能为空" },
      {
        validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请输入金额'));
            return;
          }
          // 验证数字格式
          if (!/^-?\d{0,5}(\.\d{0,2})?$/.test(value)) {
            callback(new Error('只能输入数字,整数部分不超过5位，小数部分不超过2位'));
            return;
          }
          
          // 验证数值范围
          const num = parseFloat(value);
          if (isNaN(num)) {
            callback(new Error('请输入有效数字'));
          } else if (num < 0) {
            callback(new Error('请输入正数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    returnCityId:[{ required: true, trigger: "blur", message: "不能为空" }],
    outDate:[{ required: true, trigger: "blur", message: "不能为空" }],
    overdueFeeDay:[
      { required: true, trigger: "blur", message: "不能为空" },
      { max:3, trigger: "blur", message: "最多输入3位"},
      {
        validator: (rule, value, callback) => {
          if (!/^[1-9]\d*$/.test(value)) {
            callback(new Error('请输入有效的正整数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    boxUsagePeriod:[
      { required: true, trigger: "blur", message: "不能为空" },
      { max:3, trigger: "blur", message: "最多输入3位"},
      {
        validator: (rule, value, callback) => {
          if (!/^[1-9]\d*$/.test(value)) {
            callback(new Error('请输入有效的正整数'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
    agentName:[
      { required: true, trigger: "blur", message: "不能为空" },
      { max:200, trigger: "blur", message: "最多输入200位"},
      { 
        validator: (rule, value, callback) => {
          if(containsNewlines(value)){
            callback(new Error('禁止输入换行符'));
          }else if(containsEmoji(value)){
            callback(new Error('禁止表情符号'));
          }else{
            callback();
          }
        },
        trigger: 'blur' 
      }
    ],
    remark:[
      {max:1000, message: '只能输入1000个字符',trigger: 'blur'},
      {
          validator: (rule, value, callback) => {
            if (containsEmoji(value)) {
              callback(new Error('不能包含表情符号'));
            } else if (containsNewlines(value)) {
              callback(new Error('不能包含换行符'));
            } else {
              callback();
            }
          },
          trigger: 'blur'
        }
    ]
}

const containerRules4 = {  //卖出买入集装箱
    containerNo:[{ required: true, trigger: "blur", message: "不能为空" }],
    boxType:[{ required: true, trigger: "blur", message: "不能为空" }],
    boxCondition:[{ required: true, trigger: "blur", message: "不能为空" }],
    containerClassify:[{ required: true, trigger: "blur", message: "不能为空" }],
    businessNo:[
      { required: true, trigger: "blur", message: "业务编号不能为空" },
      { pattern: /^[a-zA-Z0-9]+$/, message: '只能输入字母和数字',trigger: 'blur' },
      { max: 30, message: '只能输入30个字符',trigger: 'blur' }
    ],
    sellDate:[{ required: true, trigger: "blur", message: "不能为空" }],
    buyInPrice:[
      { required: true, trigger: "blur", message: "不能为空" },
      { 
        validator: (rule, value, callback) => {
          // 检查是否为有效数字
         if (isNaN(Number(value))) {
           return callback(new Error('必须为数字'));
         }
         // 检查大于等于1的数字不能以0开头
         const numValue = Number(value);
         if (numValue >= 1) {
            const strValue = value.toString();
            if (strValue.substring(0,1) == '0') {
              return callback(new Error('数字格式错误，请检查并修改'));
            }
         }
          // 检查小于1的数字必须以0.开头
         if (numValue < 1) {
            const strValue = value.toString();
            if (strValue.substring(0,2) != '0.') {
              return callback(new Error('数字格式错误，请检查并修改'));
            }
          }
          // 检查整数位数
         if (value.toString().includes('.')) {
          const decimalPart = value.toString().split('.')[0];
          if (decimalPart.length > 5) {
            return callback(new Error('整数部分不能超过5位'));
          }
        }
          // 检查小数位数
         if (value.toString().includes('.')) {
           const decimalPart = value.toString().split('.')[1];
           if (decimalPart.length > 2) {
             return callback(new Error('小数部分不能超过2位'));
           }
         }
         // 检查总长度（包括小数点）
         if (value.toString().length > 8) {
           return callback(new Error('数字长度不能超过8位'));
         }
       },
        trigger: 'blur'
      }
    ],
    sellOutPrice:[
      { required: true, trigger: "blur", message: "不能为空" },
      { 
        validator: (rule, value, callback) => {
           // 检查是否为有效数字
          if (isNaN(Number(value))) {
            return callback(new Error('必须为数字'));
          }
          // 检查大于等于1的数字不能以0开头
          const numValue = Number(value);
          if (numValue >= 1) {
             const strValue = value.toString();
             if (strValue.substring(0,1) == '0') {
               return callback(new Error('数字格式错误，请检查并修改'));
             }
          }
           // 检查小于1的数字必须以0.开头
          if (numValue < 1) {
             const strValue = value.toString();
             if (strValue.substring(0,2) != '0.') {
               return callback(new Error('数字格式错误，请检查并修改'));
             }
           }
          // 检查整数位数
          if (value.toString().includes('.')) {
            const decimalPart = value.toString().split('.')[0];
            if (decimalPart.length > 5) {
              return callback(new Error('整数部分不能超过5位'));
            }
          }
           // 检查小数位数
          if (value.toString().includes('.')) {
            const decimalPart = value.toString().split('.')[1];
            if (decimalPart.length > 2) {
              return callback(new Error('小数部分不能超过2位'));
            }
          }
          // 检查总长度（包括小数点）
          if (value.toString().length > 8) {
            return callback(new Error('数字长度不能超过8位'));
          }
        },
        trigger: 'blur'
      }
    ],
    receivableLiftingFee:[
      { required: true, trigger: "blur", message: "不能为空" },
      { 
        validator: (rule, value, callback) => {
          // 检查是否为有效数字
         if (isNaN(Number(value))) {
           return callback(new Error('必须为数字'));
         }
         // 检查大于等于1的数字不能以0开头
         const numValue = Number(value);
         if (numValue >= 1) {
            const strValue = value.toString();
            if (strValue.substring(0,1) == '0') {
              return callback(new Error('数字格式错误，请检查并修改'));
            }
         }
          // 检查小于1的数字必须以0.开头
         if (numValue < 1) {
            const strValue = value.toString();
            if (strValue.substring(0,2) != '0.') {
              return callback(new Error('数字格式错误，请检查并修改'));
            }
          }
           // 检查整数位数
          if (value.toString().includes('.')) {
            const decimalPart = value.toString().split('.')[0];
            if (decimalPart.length > 5) {
              return callback(new Error('整数部分不能超过5位'));
            }
          }
          // 检查小数位数
         if (value.toString().includes('.')) {
           const decimalPart = value.toString().split('.')[1];
           if (decimalPart.length > 2) {
             return callback(new Error('小数部分不能超过2位'));
           }
         }
         // 检查总长度（包括小数点）
         if (value.toString().length > 8) {
           return callback(new Error('数字长度不能超过8位'));
         }
       },
        trigger: 'blur'
      }
    ],
    receivableStorageFeePrice:[
      { required: true, trigger: "blur", message: "不能为空" },
      { 
        validator: (rule, value, callback) => {
          // 检查是否为有效数字
         if (isNaN(Number(value))) {
           return callback(new Error('必须为数字'));
         }
         // 检查大于等于1的数字不能以0开头
         const numValue = Number(value);
         if (numValue >= 1) {
            const strValue = value.toString();
            if (strValue.substring(0,1) == '0') {
              return callback(new Error('数字格式错误，请检查并修改'));
            }
         }
          // 检查小于1的数字必须以0.开头
         if (numValue < 1) {
            const strValue = value.toString();
            if (strValue.substring(0,2) != '0.') {
              return callback(new Error('数字格式错误，请检查并修改'));
            }
          }
           // 检查整数位数
          if (value.toString().includes('.')) {
            const decimalPart = value.toString().split('.')[0];
            if (decimalPart.length > 5) {
              return callback(new Error('整数部分不能超过5位'));
            }
          }
          // 检查小数位数
         if (value.toString().includes('.')) {
           const decimalPart = value.toString().split('.')[1];
           if (decimalPart.length > 2) {
             return callback(new Error('小数部分不能超过2位'));
           }
         }
         // 检查总长度（包括小数点）
         if (value.toString().length > 8) {
           return callback(new Error('数字长度不能超过8位'));
         }
       },
        trigger: 'blur'
      }
    ],
    outBoxCompanyName:[{ required: true, trigger: "blur", message: "不能为空" }],
    buyDate:[{ required: true, trigger: "blur", message: "不能为空" }],
    buyCityId:[{ required: true, trigger: "blur", message: "不能为空" }],
    inDate:[{ required: true, trigger: "blur", message: "不能为空" }],
    agentName:[
      { required: true, trigger: "blur", message: "不能为空" },
      { max:200, trigger: "blur", message: "最多输入200位"},
      { 
        validator: (rule, value, callback) => {
          if(containsNewlines(value)){
            callback(new Error('禁止输入换行符'));
          }else if(containsEmoji(value)){
            callback(new Error('禁止表情符号'));
          }else{
            callback();
          }
        },
        trigger: 'blur' 
      }
    ],
    remark:[
      {max:1000, message: '只能输入1000个字符',trigger: 'blur'},
      {
          validator: (rule, value, callback) => {
            if (containsEmoji(value)) {
              callback(new Error('不能包含表情符号'));
            } else if (containsNewlines(value)) {
              callback(new Error('不能包含换行符'));
            } else {
              callback();
            }
          },
          trigger: 'blur'
        }
    ]
}
const yardRuler1 = { //  发布堆场
  countryId:[
    { required: true, trigger: "blur", message: "不能为空" }
  ],
  cityId:[
    { required: true, trigger: "blur", message: "不能为空" }
  ],
  yardPort:[
    { required: true, trigger: "blur", message: "不能为空" },
    { max: 200, trigger: "change", message: "不能超过200个字符" },
    { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
    { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
  ],
  yardName:[
    { required: true, trigger: "blur", message: "不能为空" },
    { max: 200, trigger: "change", message: "不能超过200个字符" },
    { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
    { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
  ],
  yardAddress:[
    { required: true, trigger: "blur", message: "不能为空" },
    { max: 1000, trigger: "change", message: "不能超过1000个字符" },
    { pattern:/^[^\n\u{1F600}-\u{1F64F}]+$/u, message: "不能包含换行符或表情", trigger: "blur" },
    { pattern:/^[\w\u4e00-\u9fa5\p{P}\p{S}]+$/u, message: "只能输入文字、数字、符号", trigger: "blur" }
  ],
  yardArea:[
    { required: true, trigger: "blur", message: "不能为空" },
    { pattern: /^\d*$/, message: '只能输入数字', trigger: 'blur' },
    { max: 8, trigger: "blur", message: "不能超过8位数字" },
  ],
  throughputAbility:[
    { required: true, trigger: "blur", message: "不能为空" },
    { pattern: /^\d*$/, message: '只能输入数字', trigger: 'blur' },
    { max: 8, trigger: "blur", message: "不能超过8位数字" },
  ],
  storageCapacity:[
    { required: true, trigger: "blur", message: "不能为空" },
    { pattern: /^\d*$/, message: '只能输入数字', trigger: 'blur' },
    { max: 8, trigger: "blur", message: "不能超过8位数字" },
  ],
  yardContacts:[
    { required: true, trigger: "blur", message: "不能为空" }
  ],
  remark:[
    { max: 1000, trigger: "blur", message: "不能超过1000位字符" },
  ],
}

export default {
    yardRrules,
    containerRules1,
    containerRules2,
    containerRules3,
    containerRules4,
    yardRuler1
}
// 各国主要语言
const validateInternationalText =(value)=> {
  // 主要语言的Unicode范围：
  // 中文: \u4e00-\u9fa5
  // 日文: \u3040-\u309F（平假名）, \u30A0-\u30FF（片假名）, \u4e00-\u9faf（汉字）
  // 韩文: \uAC00-\uD7AF
  // 西文（拉丁）: \u00C0-\u00FF（带重音）, \u0100-\u017F（扩展拉丁）
  // 俄文: \u0400-\u04FF
  // 希腊文: \u0370-\u03FF
  // 阿拉伯文: \u0600-\u06FF
  // 希伯来文: \u0590-\u05FF
  // 泰文: \u0E00-\u0E7F
  const internationalRegex = /^[\u4e00-\u9fa5\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\u00C0-\u00FF\u0100-\u017F\u0400-\u04FF\u0370-\u03FF\u0600-\u06FF\u0590-\u05FF\u0E00-\u0E7F\s]+$/;
  return internationalRegex.test(value);
}
// 检查是否包含表情符
const containsEmoji = (text)=> {
  const emojiRegex = /[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{FE00}-\u{FE0F}]/gu;
  return emojiRegex.test(text);
}
// 检查是否包含换行符
const containsNewlines = (text) => {
  return /[\r\n]/.test(text);
}